package com.qing.microservices.shirostudy;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.generator.FastAutoGenerator;
import com.baomidou.mybatisplus.generator.IFill;
import com.baomidou.mybatisplus.generator.config.DataSourceConfig;
import com.baomidou.mybatisplus.generator.config.OutputFile;
import com.baomidou.mybatisplus.generator.config.rules.DateType;
import com.baomidou.mybatisplus.generator.fill.Column;

import java.util.Collections;

/**
 * @author guoqf
 */
public class MybatisPlusCodeGenerator {
    public static void main(String[] args) {
        FastAutoGenerator.create(new DataSourceConfig.Builder("jdbc:mysql://10.21.171.218:3304/mytest?allowPublikKeyRetrieval=true&useSSL=false", "cmcc", "cmcc"))
                .globalConfig(builder -> {
                    builder.author("Q").dateType(DateType.ONLY_DATE)
                            .outputDir("D:\\Workspaces\\MySpace\\IDEA\\microservices\\spring-boot-study\\shiro-study\\src\\main\\java");
                })
                .packageConfig(builder -> {
                    builder.parent("com.qing.microservices.shirostudy")
                            .pathInfo(Collections.singletonMap(OutputFile.xml, "D:\\Workspaces\\MySpace\\IDEA\\microservices\\spring-boot-study\\shiro-study\\src\\main\\resources\\mapper"));
                }).strategyConfig(builder -> {
                    builder.addInclude("user_role", "role_authority");

                    builder.entityBuilder().idType(IdType.ASSIGN_ID);
                }).execute();
        ;


    }
}
